package com.huluobo.h3kotlindemo.home

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.huluobo.h3kotlindemo.R
import com.huluobo.h3kotlindemo.util.ImageLoader

/**
 *  Created by LC on 2023/11/4.
 */
class HomeAdapter(homeGoodsList: MutableList<HomeListBean>) :
    BaseQuickAdapter<HomeListBean, BaseViewHolder>(R.layout.item_home_goods_list, homeGoodsList) {
    override fun convert(holder: BaseViewHolder, item: HomeListBean) {
        holder.setText(R.id.home_item_tv_goods_name, item.goods_desc)
        holder.setText(R.id.home_item_tv_goods_price, "原价:￥${item.goods_default_price}元")
        ImageLoader.loadRoundImage(context, item.goods_default_icon, 20, holder.getView(R.id.home_item_iv_goods_icon))
    }
}